package com.chainyoung.component_tmtrade.api;

import com.chainyoung.common.appcommon.entity.CommonList;
import com.chainyoung.common.appcommon.entity.RecieveAccount;
import com.chainyoung.common.appcommon.entity.UploadFile;
import com.chainyoung.common.base.BaseResponse;
import com.chainyoung.component_tmtrade.bean.Ad;
import com.chainyoung.component_tmtrade.bean.CurrencyMarketList;
import com.chainyoung.component_tmtrade.bean.FiatCoin;
import com.chainyoung.component_tmtrade.bean.FiatOrder;
import com.chainyoung.component_tmtrade.bean.FiatTradeListItem;
import com.chainyoung.component_tmtrade.bean.MyBanlance;
import com.chainyoung.component_tmtrade.bean.OrderDetail;
import com.chainyoung.component_tmtrade.bean.RegionList;
import com.chainyoung.component_tmtrade.bean.TotalAsset;
import com.chainyoung.component_tmtrade.bean.TradeCurrencyItem;
import com.chainyoung.component_tmtrade.bean.TradeResult;
import com.chainyoung.component_tmtrade.constant.TradeServerConstant;

import java.util.List;
import java.util.TreeMap;

import io.reactivex.Flowable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface TradeService {

    @FormUrlEncoded
    @POST(TradeServerConstant.ADD_EXCHANGE)
    Flowable<BaseResponse<Object>> addExchange(@FieldMap TreeMap<String, Object> map);

    @FormUrlEncoded
    @POST(TradeServerConstant.GET_MY_BALANCE)
    Flowable<BaseResponse<MyBanlance>> getMyBalance(@FieldMap TreeMap<String, Object> map);


    @FormUrlEncoded
    @POST(TradeServerConstant.EXCHANGE_TRADE_LIST)
    Flowable<BaseResponse<CommonList<TradeCurrencyItem>>> getExchangeTradeList(@FieldMap TreeMap<String, Object> map);


    @FormUrlEncoded
    @POST(TradeServerConstant.CANCEL_EXCHANGE)
    Flowable<BaseResponse<Object>> cancelExchange(@FieldMap TreeMap<String, Object> map);



    @POST(TradeServerConstant.REGION_LIST)
    Flowable<BaseResponse<RegionList>> getRegionList();


    @FormUrlEncoded
    @POST(TradeServerConstant.MARKET_LIST)
    Flowable<BaseResponse<CurrencyMarketList>> getCurrencyMarketList(@FieldMap TreeMap<String, Object> map);


    @FormUrlEncoded
    @POST(TradeServerConstant.FIAT_TRADE_LIST)
    Flowable<BaseResponse<CommonList<FiatTradeListItem>>> getFiatTradeList(@FieldMap TreeMap<String, Object> map);


    @FormUrlEncoded
    @POST(TradeServerConstant.FIAT_ORDER_LIST)
    Flowable<BaseResponse<CommonList<FiatOrder>>> getFiatOrder(@FieldMap TreeMap<String, Object> map);

    @FormUrlEncoded
    @POST(TradeServerConstant.FIAT_UP_TRADE)
    Flowable<BaseResponse<TradeResult>> submitOrder(@FieldMap TreeMap<String, Object> map);

    @FormUrlEncoded
    @POST(TradeServerConstant.FIAT_ORDER_INFO)
    Flowable<BaseResponse<OrderDetail>> getOrderDetail(@FieldMap TreeMap<String, Object> map);


    @FormUrlEncoded
    @POST(TradeServerConstant.FIAT_CANCEL_ORDER)
    Flowable<BaseResponse<String>> cancelOrder(@FieldMap TreeMap<String, Object> map);


    @FormUrlEncoded
    @POST(TradeServerConstant.FIAT_CONFIRM_PAYED)
    Flowable<BaseResponse<String>> confirmPayed(@FieldMap TreeMap<String, Object> map);

    @FormUrlEncoded
    @POST(TradeServerConstant.FIAT_CONFIRM_REALEASE)
    Flowable<BaseResponse<String>> confirmRelease(@FieldMap TreeMap<String, Object> map);

    @FormUrlEncoded
    @POST(TradeServerConstant.GET_TOTAL_ASSET)
    Flowable<BaseResponse<TotalAsset>> getTotalAsset(@FieldMap TreeMap<String, Object> map);

    @FormUrlEncoded
    @POST(TradeServerConstant.GET_RECIEVE_ACCOUNT_LIST)
    Flowable<BaseResponse<List<RecieveAccount>>> getRecieveAccount(@FieldMap TreeMap<String, Object> map);



    @POST(TradeServerConstant.UPLOAD_PAY_IMG)
    Flowable<BaseResponse<UploadFile>> upLoadPayImg(@Body RequestBody parms);


    @POST(TradeServerConstant.FIAT_CURRENCY_)
    Flowable<BaseResponse<Ad>> getFiatCurrencyNotice();



    @POST(TradeServerConstant.GET_FIAT_COIN_LIST)
    Flowable<BaseResponse<List<FiatCoin>>> getFiatCoinList();




}
